﻿using System.Reflection;
namespace CoreEx.Database.Linq
{
    /// <summary>
    /// Represents a class that is capable of providing an alias 
    /// for a given <see cref="MemberInfo"/> instance.
    /// </summary>
    public interface IAliasProvider
    {
        /// <summary>
        /// Gets an alias based on the supplied <paramref name="member"/>
        /// </summary>
        /// <param name="member">The <see cref="MemberInfo"/> for which to return an alias.</param>
        /// <returns></returns>
        /// <remarks>
        /// If the <paramref name="member"/> represents an existing alias, 
        /// a new alias should be created for this member.
        /// </remarks>
        string GetAliasFor(MemberInfo member);

        /// <summary>
        /// Resets the <see cref="IAliasProvider"/> and 
        /// clears the internal list of used aliases.
        /// </summary>
        void Reset();
    }
}
